package com.yonyougov.devops.cruxcisupport.k8s.configmap;

import com.yonyougov.devops.cruxcisupport.k8s.error.K8sConfIgNotFindException;
import io.fabric8.kubernetes.api.model.ConfigMap;

/**
 * 操作k8s configMap
 */
public interface ConfigMapRepository {
    /**
     * 创建或者替换configMap
     * @param request 参数
     * @return ConfigMap
     */
    ConfigMap createOrReplace(ConfigMapRequest request) throws K8sConfIgNotFindException, InterruptedException;

    /**
     * 根据名称查询configMap信息
     * @param name 名称
     * @return ConfigMap
     */
    ConfigMap get(String name, String nameSpace) throws K8sConfIgNotFindException;
}
